#include <bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for (int i = a; i < b; ++i)
const int N = 1e5 + 10;
int n;
int a[N];
int q;
typedef long long ll;
int c1, bn;
ll nodec;
void cg(int i, int x) {
  if (i > n) return;
  if (a[i] > 0) nodec -= a[i];
  a[i] += x;
  if (a[i] > 0) nodec += a[i];
}
int main() {
  cin >> n;
  rep(i, 1, n + 1) cin >> a[i];
  for (int i = n; i >= 2; --i) {
    a[i] -= a[i - 1];
    if (a[i] > 0) nodec += a[i];
  }

  cout << (a[1] + nodec + 1) / 2 << endl;

  cin >> q;
  while (q--) {
    int l, r, x;
    cin >> l >> r >> x;
    if (l == 1)
      a[1] += x;
    else
      cg(l, x);
    cg(r + 1, -x);
    cout << (a[1] + nodec + 1) / 2 << endl;
  }
}
